#include "widget.h"
#include "ui_widget.h"
#include <fstream>
#include <QDebug>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    std::ifstream file("C:/Users/fkg/Desktop/list_c++.txt");
    if(!file.is_open())
    {
        qDebug() << "文件打开失败";
        return;
    }
    std::string ret;
    while(std::getline(file, ret))
    {
        ui->comboBox->addItem(QString::fromStdString(ret));
    }
    file.close();
}

Widget::~Widget()
{
    delete ui;
}

